package com.you.concurrent.juc.countdownlatch;

import java.util.concurrent.CountDownLatch;

public class BatchExecuteTaskThread implements Runnable {

    private int threadNo;

    private CountDownLatch countDownLatch;

    public BatchExecuteTaskThread(int threadNo, CountDownLatch countDownLatch) {
        this.threadNo = threadNo;
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {
        System.out.println("--------" + threadNo);
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        countDownLatch.countDown();
    }
}
